{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import QUANTAXIS as QA\n",
    "import numpy as np\n",
    "from  datetime import timedelta ,datetime\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "stock_list=QA.QA_fetch_stock_list().index.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "torday=datetime.now()\n",
    "start_date=torday+timedelta(days=-360*2)\n",
    "data_bfq=QA.QA_fetch_stock_day_adv(stock_list,start=start_date,end=torday)\n",
    "data_hfq=data_bfq.to_hfq()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "('E:\\\\desktop\\\\data\\\\data_hfq.h5', 'data_hfq')"
     },
     "metadata": {},
     "execution_count": 4
    }
   ],
   "source": [
    "path='E:\\\\desktop\\\\data\\\\'\n",
    "data_bfq.to_hdf(path+\"data_bfq.h5\",\"data_bfq\")\n",
    "data_hfq.to_hdf(path+\"data_hfq.h5\",'data_hfq')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# a=pd.read_hdf(\"C:\\\\Users\\\\clclcl\\\\Desktop\\\\data\\\\data_bfq.h5\",\"data_bfq\")\n",
    "# b=pd.read_hdf(\"C:\\\\Users\\\\clclcl\\\\Desktop\\\\data\\\\data_hfq.h5\",\"data_hfq\")\n",
    "# b[\"avg\"]=b[\"amount\"]/b[\"volume\"]/100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "version": "3.7.0-final"
  },
  "orig_nbformat": 2,
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "npconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": 3,
  "kernelspec": {
   "name": "python_defaultSpec_1595947655700",
   "display_name": "Python 3.7.0 64-bit ('base': conda)"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}